Skip to content

Add PACKAGEVERSION token expansion for manifest fields#6312

Open
Trenly wants to merge 2 commits into
microsoft:masterfrom
Trenly:trenly/packageversion-token-4494
Open

Add PACKAGEVERSION token expansion for manifest fields#6312
Trenly wants to merge 2 commits into
microsoft:masterfrom
Trenly:trenly/packageversion-token-4494

Conversation

@Trenly

@Trenly Trenly commented Jun 21, 2026

Copy link
Copy Markdown
Contributor

📖 Description

This PR adds <PACKAGEVERSION> token expansion for manifest data fields that can include versioned values.

Implemented behavior:

  • Expand <PACKAGEVERSION> at manifest parse time (YAML and REST), distinct from runtime installer argument token replacement like <LOGPATH>.
  • Supported fields:
    • Installers[*].NestedInstallerFiles[*].RelativeFilePath
    • Installers[*].ProductCode
    • Installers[*].AppsAndFeaturesEntries[*].DisplayName
    • Installers[*].AppsAndFeaturesEntries[*].ProductCode
    • Installers[*].InstallationMetadata.DefaultInstallLocation
    • Installers[*].InstallationMetadata.Files[*].RelativeFilePath
    • DefaultLocale.ReleaseNotesUrl
    • Localization[*].ReleaseNotesUrl
  • Added/updated parser tests and test collateral.
  • Added release note entry under New Features.
  • Added PACKAGEVERSION to the spelling allowlist.

This PR was prepared with assistance from GitHub Copilot.

🔗 References

Resolves #4494

🔍 Validation

  • Added and updated unit test coverage in:
    • src/AppInstallerCLITests/YamlManifest.cpp
    • src/AppInstallerCLITests/RestInterface_1_4.cpp
  • Added test data:
    • src/AppInstallerCLITests/TestData/Manifest-Good-PackageVersionToken.yaml
    • and wired it in src/AppInstallerCLITests/AppInstallerCLITests.vcxproj

✅ Checklist

📋 Issue Type

  • Bug fix
  • Feature
  • Task

- Expand <PACKAGEVERSION> in supported manifest fields for YAML and REST parsing
- Add/adjust YAML and REST tests and test data coverage
- Update release notes with explicit supported fields

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@Trenly Trenly marked this pull request as ready for review June 21, 2026 16:01
@Trenly Trenly requested a review from a team as a code owner June 21, 2026 16:01
@github-actions

This comment has been minimized.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

@JohnMcPMS JohnMcPMS left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not seeing the ROI on taking this change. What is the scenario other than "If I modify the manifest manually I can just change 1 location (instead of find/replace that one thing)."

@Trenly

Trenly commented Jun 24, 2026

Copy link
Copy Markdown
Contributor Author

I'm not seeing the ROI on taking this change. What is the scenario other than "If I modify the manifest manually I can just change 1 location (instead of find/replace that one thing)."

You're correct that it is primarily ease of authorship. I've also seen scenarios where WingetBot creates updates but things like 'DisplayName` aren’t updated - leading to noise and inconsistiencies if it slips through Stephens automated review and not a manual review. Or similarly, if an exe puts the version as part of their product code manifest updates don’t always catch that - especially if not carefully reviewed

Granted, authorship scenarios are certainly edge cases and the example above could (and probably should) be fixed in other ways. I also see future value in other fields like documentation URLs if those change per version - where tooling (including wingetcreate) doesn’t necessarily remove or update the field automatically.

This was just an idea I had to making it easier for contributors, but understand if this isn’t something the team wants to take in

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add <PACKAGEVERSION> token

2 participants